package insight.google.game.era.bo.card;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;

import javax.jdo.annotations.FetchGroup;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

import insight.google.game.era.data.Card;
import insight.google.game.era.data.policys.Policy;
import insight.google.game.era.bo.GameRoom;
import insight.google.game.era.bo.GameUser;
import insight.google.game.era.bo.policy.AbstractPolicy;
import insight.google.game.era.bo.policy.PolicyCenter;
import insight.google.game.era.bo.policy.gamecard.AttackHorsePolicy;
import insight.google.game.era.bo.policy.gamecard.AttackPolicy;
import insight.google.game.era.bo.policy.gamecard.BowPolicy;
import insight.google.game.era.bo.policy.gamecard.DefendHorsePolicy;
import insight.google.game.era.bo.policy.gamecard.DefendPolicy;
import insight.google.game.era.bo.policy.gamecard.MilkPolicy;
import insight.google.game.era.bo.policy.gamecard.SwordPolicy; //import insight.google.game.era.bo.policy.card.WeaponPolicy;
import insight.google.game.era.client.proxy.PlayerClientProxy;
import insight.google.game.era.client.proxy.PlayerClientProxyImpl;
import insight.google.game.era.core.Util;

import org.directwebremoting.annotations.DataTransferObject;
import org.directwebremoting.annotations.RemoteProperty;

@DataTransferObject
public class GameCard extends Card {

	/**
	 * 
	 */

	private static int generateId = 0;

	@RemoteProperty
	@Persistent
	private String cardType;

	@RemoteProperty
	@Persistent
	private int distance;

	@RemoteProperty
	@Persistent
	private String displayName;

	@Persistent(defaultFetchGroup="true")
	private GameRoom room;

	@RemoteProperty
	@Persistent
	private String generatedCardId;

	public GameCard(String cardName, String type, String color, String suite,
			String rank, String cardType, int distance, String displayName) {
		this.name = cardName;
		this.type = type;
		this.color = color;
		this.suite = suite;
		this.rank = rank;
		this.cardType = cardType;
		this.distance = distance;
		this.displayName = displayName;
		this.id = this.name + "_" + this.type + "_" + this.color + "_" 
			+ this.suite + "_" + this.rank + "_" + this.cardType + "_" 
			+ this.distance + "_" + this.displayName; 
		this.generatedCardId = this.generateCardId();
	}

	private String generateCardId() {
		generateId++;
		return this.name + generateId;
	}

	private String generateCardId(String name) {
		generateId++;
		return name + generateId;
	}

	public String getCardType() {
		return cardType;
	}

	public void setCardType(String cardType) {
		this.cardType = cardType;
	}

	public int getDistance() {
		return distance;
	}

	public void setDistance(int distance) {
		this.distance = distance;
	}

	public static int getGenerateId() {
		return generateId;
	}

	public static void setGenerateId(int generateId) {
		GameCard.generateId = generateId;
	}

	@RemoteProperty
	public String getName() {
		return name;
	}

	public String getGeneratedCardId() {
		return generatedCardId;
	}

	public void setGeneratedCardId(String generatedCardId) {
		this.generatedCardId = generatedCardId;
	}

	public GameRoom getRoom() {
		return room;
	}

	public void setRoom(GameRoom room) {
		this.room = room;
	}

	public void execute(GameUser fromUser, GameUser targets[], Map params) {
		// execute card policy
		PolicyCenter pCenter = PolicyCenter.getInstance();
		pCenter.executeCardPolicy(this.policyList, fromUser, targets, params);
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	public static List<GameCard> getInitGameCards() {
		List<GameCard> gameCards = new ArrayList<GameCard>();

		GameCard card = null;

		// add 30 attack cards
		List<Integer> policyList = new ArrayList();
		policyList.add(PolicyCenter.POLICY_GAME_CARD_ATTACK);

		// add 7 black spade cards
		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.A7.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.A8.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.A9.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.A10.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.A8.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.A9.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.A10.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// add 14 club cards
		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A2.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A3.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A4.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A5.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A6.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A7.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A8.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A9.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A10.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.AJ.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A8.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A9.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A10.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.AJ.toString(), "base",
				1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// add 3 red heart cards
		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.A10.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.A10.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.AJ.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// add 6 diamond cards
		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A6.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A7.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A8.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A9.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A10.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.AK.toString(),
				"base", 1, "Attack");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// set 15 defend cards
		policyList = new ArrayList();
		policyList.add(PolicyCenter.POLICY_GAME_CARD_DEFEND);

		// add 3 heart cards
		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.A2.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.AK.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.A2.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// add 12 diamond cards
		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A2.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.AJ.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A2.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A3.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A4.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A5.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A6.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A7.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A8.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A9.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.A10.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.AJ.toString(),
				"base", 0, "Defend");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// set 8 milk cards
		policyList = new ArrayList();
		policyList.add(PolicyCenter.POLICY_GAME_CARD_MILK);

		// add 7 heart cards
		card = new GameCard("milk", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.A3.toString(),
				"base", 0, "Milk");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("milk", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.A4.toString(),
				"base", 0, "Milk");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("milk", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.A6.toString(),
				"base", 0, "Milk");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("milk", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.A7.toString(),
				"base", 0, "Milk");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("milk", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.A8.toString(),
				"base", 0, "Milk");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("milk", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.A9.toString(),
				"base", 0, "Milk");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("milk", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.AQ.toString(),
				"base", 0, "Milk");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// add 1 diamond card
		card = new GameCard("milk", TYPE.ACTION.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.AQ.toString(),
				"base", 0, "Milk");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// set defend horse cards
		policyList = new ArrayList();
		policyList.add(PolicyCenter.POLICY_GAME_CARD_DEFENDHORSE);

		// add 3 defend horse cards
		card = new GameCard("defendhorse", TYPE.MOVER.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.A5.toString(),
				"arm", 1, "D Horse");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defendhorse", TYPE.MOVER.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.AK.toString(),
				"arm", 1, "D Horse");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("defendhorse", TYPE.MOVER.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.A5.toString(), "arm",
				1, "D Horse");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// set attack horse cards
		policyList = new ArrayList();
		policyList.add(PolicyCenter.POLICY_GAME_CARD_ATTACKHORSE);

		// add 3 attack horse cards
		card = new GameCard("attackhorse", TYPE.MOVER.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.AK.toString(),
				"arm", 1, "A Horse");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attackhorse", TYPE.MOVER.toString(), COLOR.RED
				.toString(), SUITE.HEART.toString(), RANK.A5.toString(),
				"arm", 1, "A Horse");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("attackhorse", TYPE.MOVER.toString(), COLOR.RED
				.toString(), SUITE.DIAMOND.toString(), RANK.AK.toString(),
				"arm", 1, "A Horse");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// set 9 arm cards
		policyList = new ArrayList();
		policyList.add(PolicyCenter.POLICY_GAME_CARD_WEAPON);
		// policyList.add(new WeaponPolicy());

		// add 4 spade cards
		card = new GameCard("arm", TYPE.WEAPON.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.A2.toString(),
				"arm", 2, "Bow");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("arm", TYPE.WEAPON.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.A5.toString(),
				"arm", 2, "Bow");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("arm", TYPE.WEAPON.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.A6.toString(),
				"arm", 2, "Bow");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("arm", TYPE.WEAPON.toString(), COLOR.BLACK
				.toString(), SUITE.SPADE.toString(), RANK.AQ.toString(),
				"arm", 2, "Bow");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// add 1 club card
		card = new GameCard("arm", TYPE.WEAPON.toString(), COLOR.BLACK
				.toString(), SUITE.CLUB.toString(), RANK.AA.toString(), "arm",
				2, "Sword");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// add 1 heart card
		card = new GameCard("arm", TYPE.WEAPON.toString(),
				COLOR.RED.toString(), SUITE.HEART.toString(), RANK.A5
						.toString(), "arm", 2, "Sword");
		card.setPolicyList(policyList);
		gameCards.add(card);

		// add 3 diamond cards
		card = new GameCard("arm", TYPE.WEAPON.toString(),
				COLOR.RED.toString(), SUITE.DIAMOND.toString(), RANK.A5 
						.toString(), "arm", 2, "Sword");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card = new GameCard("arm", TYPE.WEAPON.toString(),
				COLOR.RED.toString(), SUITE.DIAMOND.toString(), RANK.AQ
						.toString(), "arm", 2, "Sword");
		card.setPolicyList(policyList);
		gameCards.add(card);

		card.setPolicyList(policyList);
		gameCards.add(card);

		Util.shuffleCards(gameCards, 2);

		return gameCards;
	}
	
	public static GameCard getGameCardById(String id){
		if(id == null) return null;
		String values[] = id.split("_");
		if(values.length >= 8){
			String cardName = values[0];
			String type = values[1];
			String cardColor = values[2];
			String cardSuite = values[3];
			String cardRank = values[4];
			String cardType = values[5];
			String strDistance = values[6];
			int distance = Integer.parseInt(strDistance);
			String displayName = values[7];
			GameCard card = new GameCard(cardName, type,
					cardColor, cardSuite, cardRank, cardType, distance, displayName);
			List<Integer> policyList = new ArrayList();
			if("attack".equals(cardName)){
				policyList.add(PolicyCenter.POLICY_GAME_CARD_ATTACK);
			}else if("defend".equals(cardName)){
				policyList.add(PolicyCenter.POLICY_GAME_CARD_DEFEND);
			}else if("milk".equals(cardName)){
				policyList.add(PolicyCenter.POLICY_GAME_CARD_MILK);
			}else if("defendhorse".equals(cardName)){
				policyList.add(PolicyCenter.POLICY_GAME_CARD_DEFENDHORSE);
			}else if("attackhorse".equals(cardName)){
				policyList.add(PolicyCenter.POLICY_GAME_CARD_ATTACKHORSE);
			}else if("arm".equals(cardName)){
				policyList.add(PolicyCenter.POLICY_GAME_CARD_WEAPON);
			}
			card.setPolicyList(policyList);
			return card;
		}
		else{
			return new GameCard("arm", TYPE.WEAPON.toString(),
					COLOR.RED.toString(), SUITE.DIAMOND.toString(), RANK.AQ
					.toString(), "arm", 2, "Sword");
		}
	}

	public static GameCard getGameCardByName(String cardName){
		GameCard card = null;
		List<Integer> policyList = new ArrayList();
		if("attack".equals(cardName)){
			policyList.add(PolicyCenter.POLICY_GAME_CARD_ATTACK);
			// add default attack cards
			card = new GameCard("attack", TYPE.ACTION.toString(), COLOR.BLACK
					.toString(), SUITE.SPADE.toString(), RANK.A7.toString(),
					"base", 1, "Attack");
			card.setPolicyList(policyList);
		}else if("defend".equals(cardName)){
			policyList.add(PolicyCenter.POLICY_GAME_CARD_DEFEND);
			card = new GameCard("defend", TYPE.ACTION.toString(), COLOR.RED
					.toString(), SUITE.HEART.toString(), RANK.A2.toString(),
					"base", 0, "Defend");
			card.setPolicyList(policyList);
		}else if("milk".equals(cardName)){
			policyList.add(PolicyCenter.POLICY_GAME_CARD_MILK);
			card = new GameCard("milk", TYPE.ACTION.toString(), COLOR.RED
					.toString(), SUITE.HEART.toString(), RANK.A3.toString(),
					"base", 0, "Milk");
			card.setPolicyList(policyList);
		}else if("defendhorse".equals(cardName)){
			policyList.add(PolicyCenter.POLICY_GAME_CARD_DEFENDHORSE);
			card = new GameCard("defendhorse", TYPE.MOVER.toString(), COLOR.BLACK
					.toString(), SUITE.SPADE.toString(), RANK.A5.toString(),
					"arm", 1, "D Horse");
			card.setPolicyList(policyList);
		}else if("attackhorse".equals(cardName)){
			policyList.add(PolicyCenter.POLICY_GAME_CARD_ATTACKHORSE);
			card = new GameCard("attackhorse", TYPE.MOVER.toString(), COLOR.BLACK
					.toString(), SUITE.SPADE.toString(), RANK.AK.toString(),
					"arm", 1, "A Horse");
			card.setPolicyList(policyList);
		}else if("arm".equals(cardName)){
			policyList.add(PolicyCenter.POLICY_GAME_CARD_WEAPON);
			card = new GameCard("arm", TYPE.WEAPON.toString(), COLOR.BLACK
					.toString(), SUITE.SPADE.toString(), RANK.A2.toString(),
					"arm", 2, "Bow");
			card.setPolicyList(policyList);
		}
		return card;
	}
}
